{template 'public/header'}

{template 'public/comhead'}

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">短信配置</a></li>
</ul>
<div class="main ygmain">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">

            <div class="panel-heading wyheader">

                短信配置

            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="lastn" class="col-sm-2 control-label">是否开启短信配置</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input onchange="opens(this)" type="radio" id="emailwy" name="open" value="1" {if $item['open']==1 || $item['open']==''}checked{/if} />
                            <label for="emailwy">开启</label>
                        </label>
                        <label class="radio-inline">
                            <input onchange="opens(this)" type="radio" id="emailwy3" name="open" value="0" {if $item['open']==0}checked{/if} />
                            <label for="emailwy3">关闭</label>
                        </label>
                    </div>
                </div>
                <div id="showall">
                <div class="form-group">
                    <label for="lastn" class="col-sm-2 control-label">短信通道</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input onchange="check(this)" type="radio" id="type1" name="type" value="1" {if $item['type']==1 || empty($item['type'])}checked{/if} />
                            <label for="type1">253云通信</label>
                        </label>
                        <label class="radio-inline">
                            <input onchange="check(this)" type="radio" id="type2" name="type" value="2" {if $item['type']==2}checked{/if} />
                            <label for="type2">腾讯云</label>
                        </label>
                    </div>
                </div>
                <div id="ytx">
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">API接口账号：</label>
                        <div class="col-sm-9">
                            <input type="text" name="api_account" value="{$item['api_account']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *位置：验证码通知短信-->产品概览-->api接口信息
                            <br>
                            链接：<a href="https://www.253.com" style="color: #f00" target="_blank">点击前往注册253云通信</a>
                            <br>
                            备注：点击链接--注册后---技术客服一对一 7*24小时服务
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">API接口密码：</label>
                        <div class="col-sm-9">
                            <input type="text" name="api_psw" value="{$item['api_psw']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">*位置：验证码通知短信-->产品概览-->api接口信息</div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">预约成功提醒</label>
                        <div class="col-sm-9">
                            <input type="text" name="buy_template" value="{$item['buy_template']}" id="buy_template" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *输入内容:【XX租车】您有一条新订单，请登录小程序查看
                            <br>模板内容：【XX租车】您有一条新订单，请登录小程序查看
                            <br>为空不发送
                        </div>
                    </div>

                </div>
                <div id="dayu">
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">AccessKey ID：</label>
                        <div class="col-sm-9">
                            <input type="text" name="dayu_accesskey" value="{$item['dayu_accesskey']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *位置：短信服务-->应用开发-->接口调用
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">Access Key Secret：</label>
                        <div class="col-sm-9">
                            <input type="text" name="dayu_accesskeysecret" value="{$item['dayu_accesskeysecret']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *位置：短信服务-->应用开发-->接口调用
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">签名名称：</label>
                        <div class="col-sm-9">
                            <input type="text" name="dayu_signname" value="{$item['dayu_signname']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *位置：短信服务-->应用开发-->签名管理
                            <br>模版类型: 短信通知   模版名称: 报名成功提醒   模板内容：您有一条新订单，请登录小程序查看。
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">下单模板code：</label>
                        <div class="col-sm-9">
                            <input type="text" name="dayu_templatecode" value="{$item['dayu_templatecode']}" class="form-control" />
                        </div>
                        <div class="help-block col-sm-push-2 col-sm-12">
                            *位置：短信服务-->应用开发-->模板管理-->模板code
                            <br>模版类型: 短信通知   模版名称: 报名成功提醒   模板内容：您有一条新订单，请登录小程序查看。
                        </div>
                    </div>

                </div>
                </div>
            </div>
        </div>
        <div class="form-group">

            <input type="submit" name="submit" value="保存设置" class="btn col-lg-3" style="color: white;background-color: #444444;margin-left: 550px;"/>

            <input type="hidden" name="token" value="{$_W['token']}" />
            <input type="hidden" name="id" value="{$item['id']}" />

        </div>

    </form>

</div>
<script type="text/javascript">
    $(function(){
        $("#frame-12").show();
        $("#yframe-12").addClass("wyactive");

        var open= $('input[name="open"]:checked').val();
        if(open==1){
            $('#showall').show();
        }else{
            $('#showall').hide();
        }

        var type= $('input[name="type"]:checked').val();
        if(type==1){
            $('#ytx').show();
            $('#dayu').hide();
        }else if(type==2){
            $('#ytx').hide();
            $('#dayu').show();
        }
    })

    function opens(){
        var open= $('input[name="open"]:checked').val();
        if(open==1){
            $('#showall').show();
        }else{
            $('#showall').hide();
        }
    }
    function check(){
        var type= $('input[name="type"]:checked').val();
        if(type==1){
            $('#ytx').show();
            $('#dayu').hide();
        }else if(type==2){
            $('#ytx').hide();
            $('#dayu').show();
        }
    }
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#acttime',
            type: 'datetime'
        });

    });


</script>